#include <iostream>

using namespace std;

int main() {

    int arr[5] = {1, 2, 3, 4, 5};

    cout << "arr[0] = " << arr[0] << endl;

    int *p = arr;

    // 利用指针访问数组的第一个元素
    cout << "*p = " << *p << endl;
    // 利用指针访问数组的第二个元素
    cout << "*(p + 1) = " << *(p + 1) << endl;

    for (int i = 0; i < 5; i++) {
        cout << "arr[" << i << "] = " << *(p + i) << endl;
    }

    return 0;
}